package com.nxmu.hire.utils;

import com.nxmu.hire.model.enums.SemesterEnum;
import org.joda.time.LocalDate;

public class HireUtil {

    /**
     * 计算学年
     * @param date
     * @return
     */
    public static Integer countSchoolYear(LocalDate date) {
        if (date == null) return null;
        return date.getMonthOfYear() <= 7 ? date.getYear() - 1 : date.getYear();
    }

    /**
     * 计算学期
     * @param date
     * @return
     */
    public static SemesterEnum countSemester(LocalDate date) {
        if (date == null) return null;
        return date.getMonthOfYear() <= 7 ? SemesterEnum.N : SemesterEnum.N;
    }


}
